package test.san.baseproject.widet

import android.content.Context
import android.util.AttributeSet
import android.view.View
import android.widget.RelativeLayout
import kotlinx.android.synthetic.main.home_item.view.*
import test.san.baseproject.R
import test.san.baseproject.model.BaseBean

class HomeItemView: RelativeLayout {

    fun setData(data: BaseBean) {
        name.text = data.lastName
        desc.text = data.token
    }

    // 自定义View  快速生成 构造方法  cmd + N
    constructor(context: Context?) : super(context)

    constructor(context: Context?, attrs: AttributeSet?) : super(context, attrs)

    constructor(context: Context?, attrs: AttributeSet?, defStyleAttr: Int) : super(context, attrs, defStyleAttr)

    init {
        View.inflate(context, R.layout.home_item, this)
    }
}